package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.check.firecontrolperson;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.check.firecontrolperson.FirecontrolPersonService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 消防人员控制器
 */
@Action
@RequestMapping(value="check/firecontrolPerson")
public class FirecontrolPersonController extends BaseController {
    @Resource
    public FirecontrolPersonService firecontrolPersonService;

    /**
     * 消防人员列表
     * @param
     * page	第几页
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * limit	每页多少条
     * @return
     */
    @At(value = "firecontrolPersonListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity firecontrolPersonListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return firecontrolPersonService.firecontrolPersonListPage(jsonParam);
    }

    /**
     * 消防人员详情
     * @param  id	消防人员的id
     * @return
     */
    @At(value = "firecontrolPersonDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity firecontrolPersonDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return firecontrolPersonService.firecontrolPersonDetail(jsonParam);
    }

    /**
     * 消防人员新增
     * @param
     * accountname	关联的用户名
     * name	姓名
     * post	职务
     * tel	办公电话
     * phone	手机号码
     * @return
     */
    @At(value = "firecontrolPersonAdd", method = RequestMethod.POST, param = { "accountname","name","phone" })
    public RespEntity firecontrolPersonAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return firecontrolPersonService.firecontrolPersonAdd(jsonParam);
    }

    /**
     * 消防人员修改
     * @param
     * accountname	关联的用户名
     * name	姓名
     * post	职务
     * tel	办公电话
     * phone	手机号码
     * id	消防人员id
     * @return
     */
    @At(value = "firecontrolPersonUpdate", method = RequestMethod.POST, param = { "accountname","name","phone","id" })
    public RespEntity firecontrolPersonUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return firecontrolPersonService.firecontrolPersonUpdate(jsonParam);
    }

    /**
     * 消防人员删除
     * @param   id	消防人员的id
     * @return
     */
    @At(value = "firecontrolPersonDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity firecontrolPersonDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return firecontrolPersonService.firecontrolPersonDelete(jsonParam);
    }






   
}